package com.exercise.hospital.service.impl;

import com.exercise.hospital.beans.Hospital;
import com.exercise.hospital.mapper.HospitalMapper;
import com.exercise.hospital.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * HospitalServiceImpl
 *
 * @author admin
 */

@Service
public class HospitalServiceImpl implements HospitalService {

    @Autowired
    private HospitalMapper hospitalMapper;

    /**
     * 获取所有 Hospital 信息
     *
     * @return
     */
    @Override
    public List<Hospital> getAllHospital() {
        return hospitalMapper.getAllHospital();
    }

    /**
     * 条件查询 Hospital
     *
     * @param name
     * @param type
     * @param department
     * @return
     */
    @Override
    public List<Hospital> getHospitalByCondition(String name, String type, String department) {
        return hospitalMapper.getHospitalByCondition(name, type, department);
    }

    /**
     * 进行挂号
     *
     * @param hospital
     */
    @Override
    public void registration(Hospital hospital) {
        hospitalMapper.registration(hospital);
    }

    /**
     * 核销挂号信息
     *
     * @param id
     */
    @Override
    public void updateRegisterInfo(Integer id) {
        hospitalMapper.updateRegisterInfo(id);
    }
}
